import type { VarInit } from "../data/var_init";
import { pyFormat } from "./PyData";

export class PyVar {
  constructor(
    public name: string,
    public initial: any
  ) {}

  static fromVarInit(v: VarInit): PyVar {
    return new PyVar(v.name, v.initial)
  }

  get expression(): string {
    // console.warn('get expression', this);
    
    return `${this.name} = ${pyFormat(this.initial)}\n`
  }
}
